var path = require('path')
var config = require(path.resolve(process.env.npm_config_wm_root, './webpack/config'))

module.exports = {
  entry: {
    app: path.posix.join(config.base.appSrcRoot, './app'),
  },
  resolve: {
    extensions: ['.js'],
    fallback: config.webpack.loaderInclude,
    alias: {
      'wm': config.base.wmRoot,
      'container': config.base.appContainerPath,
    },
    modulesDirectories: config.webpack.modulesDirectories
  },
  resolveLoader: {
    fallback: config.webpack.loaderInclude,
    modulesDirectories: config.webpack.modulesDirectories
  },
  module: {
    preLoaders: [
      {
        test: /\.(js|es6?)$/,
        loader: 'eslint',
        include: config.webpack.loaderInclude,
        exclude: /node_modules/
      }
    ],
    loaders: [
      {
        test: /\.js$/,
        include: config.webpack.loaderInclude,
        loader: 'babel-loader',
        exclude: /node_modules/
      }
    ]
  }
}
